package net.zigin.nhi.could.waste.service.impl;

import net.zigin.commons.util.ParamsMapUtil;
import net.zigin.commons.util.ReflectUtil;
import net.zigin.nhi.could.waste.vo.AreaCityVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import net.zigin.nhi.could.waste.dao.BaseMapper;
import net.zigin.nhi.could.waste.dao.AreaCityMapper;
import net.zigin.nhi.could.waste.model.AreaCity;
import net.zigin.nhi.could.waste.service.AreaCityService;

import java.util.List;

/*#################################################################*
# 说明:以下代码通过哲勤代码生成工具自动生成    
# 工具:GeneratorCode
# 作者:mgw1986                                                  
# 生成时间:2021-9-9 21:00:30                                               
##################################################################*/


/**
 * AreaCity服务实现类
 *
 * @author mgw1986
 * @version V1.0
 * @ClassName: AreaCityServiceImpl
 * @date 2021-9-9 21:00:30
 */
@Service
public class AreaCityServiceImpl extends AbstractServiceImpl<AreaCity, String> implements AreaCityService {
    @Autowired
    private AreaCityMapper areaCityMapper;

    @Override
    public BaseMapper<AreaCity, String> getMapper() {
        return areaCityMapper;
    }

    @Override
    public List<AreaCityVo> getListByProvinceCode(String provinceCode) {
        ParamsMapUtil.ParamMap<String, Object> paramMap = ParamsMapUtil.getInstance().addParam("provinceCode", provinceCode);
        List<AreaCity> areaCities = areaCityMapper.selectListByCondition(paramMap);
        return ReflectUtil.copyProperties(areaCities, AreaCityVo.class);
    }
}